﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using UIShare;
using EFong.View.Proxy;
using EFong.Contract;

namespace EFong.View.Financing
{
    public partial class Frm_现金 : BasicMdiChildForm
    {
        private Proxy.FinanceServiceProxy _financeServiceProxy { get { return Proxy.FinanceServiceProxy.GetInstance(); } }

        public Frm_现金()
        {
            InitializeComponent();
        }

        protected override void InitFields()
        {
        }

        protected override void LoadDatas()
        {
            this.spe_Cash.SetValue(_financeServiceProxy.GetCash().ReturnValue);

        }

        protected override void Events()
        {
        }

        private void bar_Main_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (e.Item.Name)
            {
                case "bbt_Save":
                    this.save();
                    break;
                case "bbt_Close":
                    this.Close();
                    break;
                default:
                    break;
            }
        }

        private void save()
        {
            if (_financeServiceProxy.SetCash(spe_Cash.GetValue()).IsSuccess)
            {
                MsgBox.Info("保存成功");
            }
        }

    }
}
